package com.example.aware;

import org.springframework.beans.factory.Aware;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;

/**
 * Aware 机制、以回调方式为bean注入spring框架本身的一些功能
 */
@SpringBootApplication
public class Example {

    public static void main(String[] args) {
        ConfigurableApplicationContext applicationContext = SpringApplication.run(Example.class, args);
        applicationContext.getBeansOfType(Aware.class).keySet().forEach(System.out::println);

    }
}
